1. Field of the Invention
The present invention relates to a technique, which uses data of an original image and data of a two-valued original image to crop a subject from the original image, and combines the cropped subject onto other image.
2. Description of the Related Art
Conventional technique is known, which uses data of an original image as data of an image including a subject to extract or crop the subject out of the original image, and combine the subject with another images. This technique is called “Dynamic Photo” (Registered Trademark).
In Dynamic Photo, when a region containing the subject is detected as an “attention region” from the original image, data of an image of two value labels is created, which contains the attention region and other region, wherein the attention region is white in color and other region is black in color. Hereinafter, the data composed of white pixels having a value “0” and black pixels having a value “1” is referred to as “data of an alpha map” or “alpha map data”, and each of the pixel values composing the alpha map is referred to as an “alpha value”.
In Dynamic Photo, data of an alpha map is used to determine the region of the subject and to extract or crop the region of the subject (hereinafter, referred to as an “extracted region”) out of the original image, and the extracted region is inserted into a separate image, whereby a composite image is created.
But if the alpha map data is used without any modification made thereto, background components of the original image can be mixed in or a lack of subject component can appear at the edge of extracted region in the resultant composite image. When such extracted region is combined with other image, such a composite image is created as containing the awkwardly cropped and pasted subject and being unnatural and less a reality.
As a conventional method used for the purpose of lightening up the above defects in the composite image, a method has been proposed, which applies an average filter on the alpha map data. The average filter means Gaussian Filter and/or a simple low pass filter similar to Gaussian Filter.
But even if this conventional method has been simply applied on the alpha map data, the edge of the subject can blur in the composite image. As a result, the resultant composite image is unnatural and less of a reality.
Further, as another method of lightening up the defects in the unnatural composite image created when the alpha map data is used as-is, a so-called “matching” method has been proposed. That is, when the alpha map data is used as-is, the resultant composite image can be made unnatural and less of a reality. This is because of pixels belonging to a boundary and/or a subject, which are judged in error due to detection error made when the attention region is detected, and further because of mixed-up pixels included in an edge. The mixed-up pixels mean those having color of a background and color of the subject in the mix.
The matching method is a method of finely resolving the edge to separate regions and pixel values of the mixed-up pixels into a background component and a subject component.
But when the matching method is executed, following difficulties (first and second problem) are invited.
The first problem resides in more calculation load, more work memory, and a large scale of circuitry required to execute the matching method.
The second problem resides in difficulty of obtaining a beautiful composite image without a precise tri-map. The tri-map is a subsidiary three-valued data, in which either of three labels such as a subject, background and suspended intermediate region is assigned to each pixel coordinate. In general, assignment of three value labels in the tri-map is made by human work. Although it is not impossible to assign three value labels automatically, it is still hard to complete a precise tri-map.
Therefore, it is desired to provide a technique, which uses data of an original image and data of an alpha map to extract a subject from the original image and combines the extracted subject with other image, thereby creating a composite image that seems more natural and real. At present, the technique, which meets the above requirements satisfactorily is not available.